package com.gxsyh.nantie.phone.consumer.configure;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @email yom535@outlook.com
 * @author: 刘锋嘉(Liu Fengjia)
 * @date: 2020/1/20
 * @time: 10:45
 * @Description:
 */
@Configuration
public class RedissonConfiguration {

    @Value("${redisson.address}")
    private String address;

    @Bean
    public RedissonClient getRedisson() {
        Config config = new Config();
        config.useSingleServer().setAddress(address).setDatabase(1).setConnectionPoolSize(32).setConnectionMinimumIdleSize(16);
        return Redisson.create(config);
    }

}
